package com.cz.datafetcher.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class CommonReturn<T> {
    private int code;
    private String msg;
    private T result;

    public static <T> CommonReturn<T> ok(T obj){
        return new CommonReturn<T>(200,"",obj);
    }

    public static <T> CommonReturn<T> error(int code,String msg){
        return new CommonReturn<>(code,msg,null);
    }
}
